import {
	defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
	server: {
		proxy: {
			'/tools': {
				target: 'https://tea.qingnian8.com',
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/tools/, '/tools')
			}
		}
	},
	plugins: [
		uni(),
		// 自动导入配置
		AutoImport({
			imports: [
				// 预设
				'vue',
				'uni-app'
			]
		})
	]
})